    var rowBox = new Vue({
        el: "#mainBody",
        data: {
            heroList: [],
            cost: '',
           number:''

        },
        methods: {
            selectHero: function (event) {
                rowBox.cost = event.target.value
                rowBox.race = event.target.textContent
                console.log(event.target.textContent);
                axios.get('http://localhost:8080/LOL/hero', {
                    params: {
                        cost: rowBox.cost,
                    }
                })
                    .then(function (data) {
                       
                        rowBox.heroList = data.data
                    })
                    .catch(function (error) {
                        console.log(error);
                    });

            },
            // 传递编号
            ret:function(e){
                window.location.href = `./heroData.html?number=${e}`;
            }
        },

        created(){
            axios.get('http://localhost:8080/LOL/hero')
                    .then(function (data) {
                        console.log(data.data);
                        rowBox.heroList = data.data
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
        },
      
        
    })

